#pragma once

#include "fxcc/core/graph/common/Maps.h"

namespace fxcc::graph::common
{
	struct AdditionChannelConfig
	{
		std::string m_Name;
		std::string m_ChannelName;
		glm::ivec3 m_KeyFlag{ 1,1,1 };
	};

	struct Entity;

	struct AnimationNode :public fxcc::Base
	{
		fxcc::graph::common::AnimationMap m_AnimationMap;

		struct AdditonConfig {

			bool m_Looping{ true };

			float m_AnimSpeed{ 1.f };

			std::vector<AdditionChannelConfig> m_AdditionaChannelConfigs;

		} m_AdditionConfig;

		float m_AnimAxis{ 0.005f };

		bool m_ReachEnd{ 0 };

		bool m_RootMotion{ 0 };
		
		void LoadAnim()
		{
			m_AnimationMap.OnLoad();
		}
		//void OnLoad(e2d::Entity* entity);

		void Tick(float deltaTime);

		void UpdateBoneData();

		//bool ProcessEntityNode(e2d::Entity* entity);

		bool SetAnimNode(const std::string& nodeName, fxcc::graph::common::AnimNode* animNode);

		std::shared_ptr<fxcc::graph::common::Animation> GetAnimation()
		{
			return m_AnimationMap.m_Value;
		}
	};
};